package com.example.controller;

import com.example.base.Action.BaseAction;
import com.example.base.ResultVO;
import com.example.entity.ProductType;
import com.example.repository.ProductTypeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/7/8.
 */
@RestController
@RequestMapping(value = "productTypeAction")
public class ProductTypeAction extends BaseAction{

    @Autowired
    private ProductTypeRepository productTypeRepository;

    /**
     * 获取在售的设备类型
     * @return
     */
    @RequestMapping("/getOnSaleProductType")
    public ResultVO getOnSaleProductType(){

        return success(productTypeRepository.findByOnSaleAndRecStatus(ProductType.ON_SALE_DISPLAY,0));
    }
}
